package yh.design.strategy;

import yh.design.common.res.APIResult;

import java.math.BigDecimal;

/**
 * 策略控制类
 * @author: zyh
 * @date: 2025/5/15 11:58
 **/
public class IPayContext<T> {

    private IPayment<T> pay;

    public IPayContext(IPayment<T> pay) {
        this.pay = pay;
    }

    //支付算法族-不同类型的支付方法
    public APIResult execPay(T payInfo, BigDecimal payAmount){
        APIResult payResult = pay.executePay(payInfo, payAmount);
        return payResult;
    }
}
